my_object = {
    "name": "Alice",
    "age": 25
}
import json
import os
filer_path = ".//os.json"
if os.path.exists(filer_path):
    try:
        with open(filer_path, "w", encoding="utf-8") as f:
            json.dump(my_object, f, ensure_ascii=False, indent=4)
            print("json文件写入成功")
    except IOError as e :
        print(f"文件写入失败：{e}")




